home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
VRML 2.0 Sourcebook (2nd Edition)
/
VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso
/
book
/
mac
/
ch18
/
18fig27.wrl
< prev
next >
Wrap
Text File
|
1996-09-23
|
1KB
|
70 lines
#VRML V2.0 utf8
# The VRML 2.0 Sourcebook
# Copyright [1997] By
# Andrea L. Ames, David R. Nadeau, and John L. Moreland
Group {
children [
# Rotating fan
Shape {
appearance Appearance {
material Material { }
texture ImageTexture {
url "fan.png"
repeatS FALSE
repeatT FALSE
}
textureTransform DEF FanRotation TextureTransform {
center 0.5 0.5
}
}
geometry DEF Square IndexedFaceSet {
coord Coordinate {
point [
-1.0 -1.0 -0.1, 1.0 -1.0 -0.1,
1.0 1.0 -0.1, -1.0 1.0 -0.1,
]
}
coordIndex [ 0, 1, 2, 3, ]
texCoord TextureCoordinate {
point [
0.0 0.0, 1.0 0.0,
1.0 1.0, 0.0 1.0,
]
}
texCoordIndex [ 0, 1, 2, 3, ]
solid FALSE
}
},
# Grill in front
Transform {
translation 0.0 0.0 0.1
children Shape {
appearance Appearance {
material Material { }
texture ImageTexture {
url "grill.png"
}
textureTransform TextureTransform {
rotation 0.785
scale 8.0 8.0
center 0.5 0.5
}
}
geometry USE Square
}
},
# Animation clock
DEF Clock TimeSensor {
cycleInterval 10.0
loop TRUE
},
# Animation path
DEF FanPath ScalarInterpolator {
key [ 0.0, 0.5, 1.0 ]
keyValue [ 0.0, 3.14, 6.28 ]
},
]
}
ROUTE Clock.fraction_changed TO FanPath.set_fraction
ROUTE FanPath.value_changed TO FanRotation.set_rotation